<template>
	<view class="container">
		<view class="title">
			课程目录
		</view>
		<view class="list">
			<view class="col" v-for="col in list" :key="col.id">
				<view class="text">
					{{col.name}}
				</view>
				<view class="item" v-for="item in col.periodVoList" :key="item.id">
					<view class="left">
						{{item.name}}
					</view>
					<view class="right">
						<view class="view">试看</view>
						<navigator url="/pages/sort/video" v-if="item.status==0">未学习</navigator>
						<view v-else class="learned">
							已学习
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			list: {
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.container {
		background-color: #fff;
	}

	.title {
		font-weight: bold;
		font-size: 36rpx;
	}

	.list {
		.col {
			padding: 20rpx 0;

			.text {
				font-weight: bold;
				position: relative;
				padding-left: 40rpx;

				&:before {
					content: "";
					width: 24rpx;
					height: 24rpx;
					background-color: #333;
					position: absolute;
					left: 0%;
					top: 50%;
					transform: translateY(-50%);
				}
			}

			.item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				position: relative;
				font-size: 24rpx;
				padding: 8rpx 0;

				&:before {
					content: "";
					width: 100%;
					border-top: 2rpx dashed #bbb;
					position: absolute;
					left: 0%;
					top: 50%;
					transform: translateY(-50%);
				}

				.left {
					background-color: #fff;
					position: relative;
					max-width: calc(100% - 150rpx);
					padding-right: 10rpx;
				}

				.right {
					background-color: #fff;
					position: relative;
					padding-right: 30rpx;
					padding-left: 10rpx;
					width: 130rpx;
					text-align: center;
					color: $assist-color2;

					.learned {
						color: #999;
					}

					&:before {
						content: "";
						position: absolute;
						width: 0;
						height: 0;
						border-top: 10rpx solid transparent;
						border-bottom: 10rpx solid transparent;
						border-left: 14rpx solid #999;
						right: 0%;
						top: 50%;
						transform: translateY(-50%);
					}

					.view {
						width: 88rpx;
						text-align: center;
						border-radius: 100px;
						border: 2rpx solid $assist-color;
						color: $assist-color;
						line-height: 44rpx;
					}
				}
			}
		}
	}
</style>